package com.snc.controller.app;


import com.snc.controller.index.BaseController;
import com.snc.entity.*;
import com.snc.plugin.Result;
import com.snc.plugin.Status;
import com.snc.util.PropertiesUtils;
import org.springframework.stereotype.Controller;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.multipart.MultipartHttpServletRequest;
import org.springframework.web.multipart.commons.CommonsMultipartResolver;

import javax.servlet.http.HttpServletRequest;
import java.io.File;
import java.util.Date;
import java.util.Iterator;
import java.util.List;
import java.util.UUID;

/**
 * APP-活动
 */
@Controller
@RequestMapping("/app/comment")
public class CommentController extends BaseController {

    /**
     * 获取活动的列表，
     * 请求参数：
     *
     * @return 数据
     */
    @ResponseBody
    @RequestMapping(value = "/list")
    public Result list() {
        CommentFormMap map = super.toFormMap(CommentFormMap.class);

        return Result.Success(CommentFormMap.mapper().select(map));
    }


    @ResponseBody
    @RequestMapping("/add")
    public Result add() throws Exception {
        CommentFormMap map = super.toFormMap(CommentFormMap.class);
        map.put("createTime",new Date());
        map.save();
        return Result.Success(null);
    }
}